import java.util.Vector;

public class OurTank extends Tank{
    Vector<Bullet> bulletVector1 = new Vector<>();
    Bullet bullet1=null;
    OurTank(int x, int y) {
        super(x, y);
        setSpeed(15);
    }

    public void attack(){
        switch(this.getDirection()){
            case 0:
                if(bulletVector1.size()<5){
                    bullet1 =new Bullet(this.getX()+7,this.getY()-3,this.getDirection());
                    bulletVector1.add(bullet1);
                    new Thread(bullet1).start();
                }
                break;
            case 1:
                if(bulletVector1.size()<5){
                    bullet1 =new Bullet(this.getX()-3,this.getY()+7,this.getDirection());
                    bulletVector1.add(bullet1);
                    new Thread(bullet1).start();
                }
                break;
            case 2:
                if(bulletVector1.size()<5){
                    bullet1 =new Bullet(this.getX()+33,this.getY()+7,this.getDirection());
                    bulletVector1.add(bullet1);
                    new Thread(bullet1).start();
                }
                break;
            case 3:
                if(bulletVector1.size()<5){
                    bullet1 =new Bullet(this.getX()+7,this.getY()+32,this.getDirection());
                    bulletVector1.add(bullet1);
                    new Thread(bullet1).start();
                }
                break;
        }
    }
}
